package cn.springboot.erp.controller;

import cn.springboot.erp.commons.QueryParams;
import cn.springboot.erp.commons.ResponseResult;
import cn.springboot.erp.entity.LogInfo;
import cn.springboot.erp.service.LogInfoService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiOperation;
import io.swagger.models.auth.In;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("logInfo")
public class LogInfoController {

    @Resource
    private LogInfoService logInfoService;

    @ApiOperation("数据分页")
    @RequestMapping("page")
    public ResponseResult listPage(@RequestBody QueryParams<LogInfo> queryParams){
        return logInfoService.listPage(queryParams);
    }

    @ApiOperation("删除日志")
    @PostMapping("deleteByIds")
    public ResponseResult deleteByIds(@RequestBody List<Integer> ids){
        logInfoService.removeBatchByIds(ids);
        return ResponseResult.Success().msg("删除成功");
    }
}
